#!/bin/bash

cd soft/

# Check if ipmitool is installed
if ! command -v ipmitool &> /dev/null
then
    # Install ipmitool
    echo "ipmitool not found, installing..."
    sudo yum install -y ./ipmitool-1.8.18-18.el8.x86_64.rpm
else
    echo "ipmitool is already installed"
fi

# Check if storcli is installed
if ! command -v storcli64 &> /dev/null
then
    # Install storcli
    echo "storcli64 not found, installing..."
    sudo rpm -Uvh --nodeps ./storcli-007.2106.0000.0000-1.noarch.rpm
    cp /opt/MegaRAID/storcli/storcli64 /sbin/
else
    echo "storcli64 is already installed"
fi

# Check if freeze is installed
if ! command -v freeze &> /dev/null
then
    # Install freeze
    echo "freeze not found, installing..."
    sudo rpm -Uvh --nodeps ./freeze-0.1.6-1.x86_64.rpm
else
    echo "freeze is already installed"
fi

cd ..

